package com.wy.app

import android.app.Application
import android.content.Context
import android.os.Vibrator


class APP : Application() {

    override fun onCreate() {
        super.onCreate()
        getSystemService(Context.VIBRATOR_SERVICE)

    }

    companion object{
        fun getVibrator(context: Context): Vibrator? {
            val vibrator = context.getSystemService(VIBRATOR_SERVICE) as Vibrator
            // 检查设备是否支持震动
            if (vibrator != null && !vibrator.hasVibrator()) {
                return null
            }
            return vibrator
        }
    }

}